package com.ash.bean.factory;

import java.util.HashMap;
import java.util.Map;

import com.ash.bean.Car;

/**
 * 实例工厂方法
 * 
 * @author zhuangjianhui01
 * 
 */
public class InstanceCarFactory {

	private Map<String, Car> carMap = new HashMap<String, Car>() {
		{
			put("audi", new Car("audi", "上海", 3000));
			put("qq", new Car("qq", "深圳", 1000));
		}
	};

	public Car getCar(String name) {
		return carMap.get(name);
	}

}
